package com.machine.action.component;

import org.apache.struts2.ServletActionContext;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;

import com.opensymphony.xwork2.ActionSupport;

@Component("lookModel")
@Scope(value = "prototype")
public class LookModel extends ActionSupport {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private String path;

	public String getPath() {
		return path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	@Override
	public String execute() throws Exception {
		//System.out.println("path : " + path);
	
		path = path.replaceAll("[\\\\]","/");
		path = path.replaceAll("/Machine/", "");
		System.out.println("path : " + path);
		ServletActionContext.getRequest().getSession().setAttribute("path", path);
		return SUCCESS;
	}

}
